<?php

declare(strict_types=1);

namespace App\Request\Store\Advertising;

use App\Request\RequestAbstract;
use Hyperf\Validation\Request\FormRequest;

/**
 * 广告添加验证器
 * @author 陈奕文
 * @package App\Request\Store\Advertising
 */
class AddRequest extends RequestAbstract
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'type' => ['required', 'integer'],
            'title' => ['required'],
            'jump_type' => ['required','integer'],
            'link' => ['url'],
            'start_time' =>['required'],
            'end_time' =>['required'],
            'image' => ['required'],
        ];
    }
}
